Example Polygon Regions

To understand how to create a polygon region in Geo SCADA Expert you need to understand the GeoJSON format for encoding geographic data structures. A GeoJSON object can represent a geometry, a feature, or a collection of features, for example, a Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection.

In Geo SCADA Expert we are primarily concerned with the Polygon object in the context of regions (for information about other types of GeoJSON objects refer to the GeoJSON Specification. A polygon region consists of a set of coordinates, which are defined by real world latitude and longitude values.

The basic element of a polygon is a point (position), to make a polygon you need at least 3 points to enclose an area.

Coordinates in GeoJSON are formatted in simple decimal format, you can not use the degrees, minutes, seconds notation.

Latitude 52° 23' 4.1" Longitude 1° 33' 33.2" West

is expressed as:

52.38446667, -1.5592217

where - is west and + is east.

Position

A position is an array of coordinates and is the smallest unit that we can really consider ‘a place’ since it can represent a point on earth. GeoJSON describes an order for coordinates: they should go, in order:

[longitude, latitude, elevation]

We do not require elevation for the definition of regions in Geo SCADA Expert, so this can be ignored.

Historically, the order of world coordinates is usually “latitude, longitude” but, data formats usually use the longitude, latitude order as they match the X, Y order of math.

Geometry

Geometries are shapes. All simple geometries in GeoJSON consist of a type and a collection of coordinates.

Polygons

Polygons are complex GeoJSON geometries, as they have area, so they have insides and outsides.

 

The following is an example of a simple three sided polygon. There are four position coordinates, the first and last coordinates must be the same to form a closed polygon.

{

"type": "Polygon",

"coordinates": [

[

[0, 0], [10, 10], [10, 0], [0, 0]

]

]

}

This code is sufficient to create a basic region within Geo SCADA Expert. The coordinates shown are list on one line, for larger polygon it is useful to list each set of coordinates on a separate line.

[

[0, 0],

[10, 10],

[10, 0],

[0, 0]

]

 

This example shows a clockwise sequence creating a six sided polygon. All the following examples of code assume that a polygon is drawn in a clockwise direction.

The definition for the polygon illustrated is shown below, if you reversed the sequence of coordinates the polygon would be created in the counter-clockwise direction:

Polygons within Polygons

It is possible to create polygons within polygons (regions within regions), in situations where you want to subdivide an region and be able to work with the whole region as well.

Polygons with holes

Polygons are not just enclosed areas, but can have cut-outs or holes. To understand how to construct polygons with cut-outs we need to introduce a new term: the LinearRing. LinearRings are a set of positions that define a line that encloses a space (a polygon), however, you can have an exterior LinearRing and none, one or more interior LinearRing. For Polygons with multiple rings:

We recommend that exterior rings are always defined in the clockwise direction and interior rings are defined in the counter-clockwise direction.

Further Information

For additional information on how to work with GeoJSON refer to the GeoJSON Specification, also the website geojson.io can be used as an aid in creating polygons.


Disclaimer

Geo SCADA Expert 2019